package com.example.user.dao.po;

import com.baomidou.mybatisplus.annotation.*;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.Date;

@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@TableName("sys_role_permission")
public class RolePermission {
    @TableId(type = IdType.AUTO)
    private Long id;

    @TableField("role_id")
    private Long roleId;

    @TableField("perm_id")
    private Long permId;

    @TableField("create_time")
    private Date createTime;

    @TableField("update_time")
    private Date updateTime;
}

//CREATE TABLE `sys_role_permission` (
//    `id` BIGINT NOT NULL AUTO_INCREMENT COMMENT '主键ID',
//    `role_id` BIGINT NOT NULL COMMENT '角色ID',
//    `perm_id` BIGINT NOT NULL COMMENT '权限ID',
//    `create_time` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
//    `update_time` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
//    PRIMARY KEY (`id`),
//    UNIQUE KEY `uniq_role_perm` (`role_id`,`perm_id`),
//    INDEX `idx_role` (`role_id`),
//    INDEX `idx_perm` (`perm_id`)
//    ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='角色权限关联表';